package com.fc.backingbeans.journal;

import javax.faces.bean.ViewScoped

import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component

import com.fc.backingbeans.AbstractDialog
import com.fc.entities.WorkoutJournal
import com.fc.service.WorkoutJournalService

/**
 * 
 * @author Ács Ádám
 *
 */
@Component("addWorkoutJournalEntryDialog")
@ViewScoped
class AddWorkoutJournalEntryDialog extends AbstractDialog {
	@Autowired private WorkoutJournalService service
	WorkoutJournal entry = new WorkoutJournal()

	void save() {
		service.create(entry)
		entry = new WorkoutJournal()
	}
	
	@Override
	String getDialogName() {
		"fc/journal/addWorkoutJournalEntry"
	}
}
